import request from '@/utils/request'

//获得所有冷库
export function getAll(query) {
  return request({
    url: '/storage/bigCold/getAll',
    method: 'get',
    params: query
  })
}
//根据id查找单个冷库
export function getBigColdById(coldId) {
  return request({
    url: '/storage/bigCold/' + coldId,
    method: 'get'
  })
}

//获得数据总条数
export function getTotal(query) {
  return request({
    url: '/storage/bigCold/getTotal',
    method: 'get',
    params: query
  })
}

// 查询岗位详细
export function getPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'get'
  })
}

//添加冷库
export function addBigCold(data) {
  return request({
    url: '/storage/bigCold/addBigCold',
    method: 'post',
    data: data
  })
}
//查找冷库管理员名单
export function getStorageUserList(data) {
  return request({
    url: '/storage/bigCold/getStorageUserList',
    method: 'post',
    data: data
  })
}
// 修改冷库
export function updateBigCold(data) {
  return request({
    url: '/storage/bigCold/updateBigCold',
    method: 'post',
    data: data
  })
}
//删除冷库
export function deleteBigCold(coldIds) {
  return request({
    url: '/storage/bigCold/'+coldIds,
    method: 'post',
  })
}

// 查询岗位列表
export function listPost(query) {
  return request({
    url: '/system/post/list',
    method: 'get',
    params: query
  })
}



// 新增岗位
export function addPost(data) {
  return request({
    url: '/system/post',
    method: 'post',
    data: data
  })
}

// 修改岗位
export function updatePost(data) {
  return request({
    url: '/system/post',
    method: 'put',
    data: data
  })
}

// 删除岗位
export function delPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'delete'
  })
}
